package cn.sirun.com.fca.account.repo.reset;

import com.tencent.cloud.iov.kernel.constant.HttpHeaderConst;
import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.base.CaptchaRequest;
import cn.sirun.com.fca.account.model.base.ResendResponse;
import cn.sirun.com.fca.account.model.base.SRPEncryptInfo;
import cn.sirun.com.fca.account.model.base.SubmitPasswordRequest;
import cn.sirun.com.fca.account.model.base.SubmitPhoneRequest;
import cn.sirun.com.fca.account.model.base.SubmitPhoneResponse;
import cn.sirun.com.fca.account.model.register.SubmitEmailRequest;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

/**
 * @author vinsonhuang
 * @date 2018/5/16
 */
public interface ResetService {

    @POST("/v2/account/reset/submit_phone")
    Observable<BaseResponse<SubmitPhoneResponse>> submitPhone(@Body SubmitPhoneRequest request);

    @Headers(HttpHeaderConst.ADD_COOKIE)
    @POST("/v2/account/reset/submit")
    Observable<BaseResponse<SRPEncryptInfo>> submitCaptcha(@Body CaptchaRequest request);

    @Headers(HttpHeaderConst.ADD_COOKIE)
    @POST("/v2/account/reset/set_password")
    Observable<BaseResponse<Void>> setPassword(@Body SubmitPasswordRequest request);

    @Headers(HttpHeaderConst.CONTENT_TYPE_JSON)
    @POST("/v2/account/reset/resend")
    Observable<BaseResponse<ResendResponse>> resend();

    @POST("/v2/account/email_reset/submit_email")
    Observable<BaseResponse<SubmitPhoneResponse>> submitEmail(@Body SubmitEmailRequest request);

    @Headers(HttpHeaderConst.ADD_COOKIE)
    @POST("/v2/account/email_reset/submit")
    Observable<BaseResponse<SRPEncryptInfo>> submitEmialCaptcha(@Body CaptchaRequest request);

    @Headers(HttpHeaderConst.ADD_COOKIE)
    @POST("/v2/account/email_reset/set_password")
    Observable<BaseResponse<Void>> setEmailPassword(@Body SubmitPasswordRequest request);

    @Headers(HttpHeaderConst.CONTENT_TYPE_JSON)
    @POST("/v2/account/email_reset/resend")
    Observable<BaseResponse<ResendResponse>> emailResend();
}
